<?php include $this->admin_tpl('meta', 'admin');?>
<title>头尾码配置</title>
<meta name="referrer" content="no-referrer" />
</head>
<body>
<article class="page-container">
  <table class="table table-border table-bordered table-bg table-hover yzm-table-sort">
    <thead>
      <tr class="text-c">
		<th width="80">尺码数</th>
		<th width="80">头码数</th>
		<th width="80">尾码数</th>
		<th width="">备注</th>
      </tr>
    </thead>
    <tbody>
		<?php 
		foreach($data as $val){
		?>
		  <tr class="text-c">
			<td><?php echo $val['chima_num'];?></td>
			<td><?php echo $val['tou_num'];?></td>
			<td><?php echo $val['wei_num'];?></td>
			<td class="text-l"><?php echo $val['remark'];?></td>
		  </tr>		
		<?php 
		}
		?>
    </tbody>
  </table>
<div style="margin-top:20px;margin-left:10px;text-align:center;">
	<button id="button" class="btn btn-warning radius">&nbsp;&nbsp;重新计算商品头尾码&nbsp;&nbsp;</button>&nbsp;&nbsp;&nbsp;&nbsp;<button id="button2" class="btn btn-primary radius">&nbsp;&nbsp;重新计算异常头尾码&nbsp;&nbsp;</button>
</div>
</article>
<?php include $this->admin_tpl('footer', 'admin');?>

<script type="text/javascript">
$(function(){
	$('#button').click(function(){
		layer.load();
		$.ajax({
			type: 'get',
			url: '<?php echo U('wp_buhuo',['type'=>'reset_touwei'])?>',
			dataType: "json", 
			success: function (msg) {
				layer.closeAll('loading');
				if(msg.status == 1){
					layer.msg(msg.message, {icon:1, time:2000}); 
				}else{
					layer.msg(msg.message, {icon:2});
				}
			}
		})
	})
	$('#button2').click(function(){
		layer.load();
		$.ajax({
			type: 'get',
			url: '<?php echo U('wp_buhuo',['type'=>'reset_touwei','error'=>1])?>',
			dataType: "json", 
			success: function (msg) {
				layer.closeAll('loading');
				if(msg.status == 1){
					layer.msg(msg.message, {icon:1, time:2000}); 
				}else{
					layer.msg(msg.message, {icon:2});
				}
			}
		})
	})
})
</script> 

</body>
</html>